#include "Log.h"


Log *Log::plog = NULL;

Log::Log(void)
{
  pFile = NULL;
}

Log::~Log(void)
{
}


void Log::setLogFile(std::string file) {
  filename = file;
}

void Log::close() {
  
  if(pFile != NULL) {
    fclose(pFile);
	pFile = NULL;
  }

  if(plog != NULL) {
    delete plog;
	plog = NULL;
  }
}

void Log::open() {
  pFile = fopen( filename.c_str(), "w" );
}



void Log::print(const char * format, ...)
{
  va_list args;
  va_start (args, format);
  vfprintf (pFile, format, args);
  fflush( pFile );
  va_end (args);
}


